Telegram Group & Telegram Channel
13. Program to Convert Binary to Decimal.

import java.io.*;

class BinaryToDecimal
{
public static void main(String[] args) throws Exception
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter Binary no. to convert in Decimal : ");
String number = br.readLine();

/*
to convert Binary number to decimal number use,
int parseInt method of Integer wrapper class.

Pass 2 as redix second argument.
*/

int decimalNumber = Integer.parseInt(number, 2);
System.out.println("Binary number converted to decimal number");
System.out.println("Decimal number is : " + decimalNumber);

}
}

@java_codings



tg-me.com/java_codings/22
Create:
Last Update:

13. Program to Convert Binary to Decimal.

import java.io.*;

class BinaryToDecimal
{
public static void main(String[] args) throws Exception
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter Binary no. to convert in Decimal : ");
String number = br.readLine();

/*
to convert Binary number to decimal number use,
int parseInt method of Integer wrapper class.

Pass 2 as redix second argument.
*/

int decimalNumber = Integer.parseInt(number, 2);
System.out.println("Binary number converted to decimal number");
System.out.println("Decimal number is : " + decimalNumber);

}
}

@java_codings

BY Advance Java πŸ‘¨β€πŸ’»


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/java_codings/22

View MORE
Open in Telegram


Advance Java ‍ Telegram | DID YOU KNOW?

Date: |

The global forecast for the Asian markets is murky following recent volatility, with crude oil prices providing support in what has been an otherwise tough month. The European markets were down and the U.S. bourses were mixed and flat and the Asian markets figure to split the difference.The TSE finished modestly lower on Friday following losses from the financial shares and property stocks.For the day, the index sank 15.09 points or 0.49 percent to finish at 3,061.35 after trading between 3,057.84 and 3,089.78. Volume was 1.39 billion shares worth 1.30 billion Singapore dollars. There were 285 decliners and 184 gainers.

The Singapore stock market has alternated between positive and negative finishes through the last five trading days since the end of the two-day winning streak in which it had added more than a dozen points or 0.4 percent. The Straits Times Index now sits just above the 3,060-point plateau and it's likely to see a narrow trading range on Monday.

Advance Java ‍ from ru


Telegram Advance Java πŸ‘¨β€πŸ’»
FROM USA